package com.spring.service.impl;

import com.spring.dao.UserDao;
import com.spring.pojo.User;
import com.spring.service.ClassNameService;
import com.spring.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * Description:
 * Copyright:   Copyright (c)2019
 * Company:     zefu
 *
 * @author: 张李鑫
 * @version: 1.0
 * Create at:   2022-02-17 10:26:50
 * <p>
 * Modification History:
 * Date         Author      Version     Description
 * ------------------------------------------------------------------
 * 2022-02-17     张李鑫                     1.0         1.0 Version
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Autowired
    private ClassNameService classNameService;


    @Override
    public void add(Integer integer) {
        classNameService.add();
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void merge() {
        this.add(1);
        try {
            classNameService.exception();
        }catch (Exception exception){
            exception.printStackTrace();
        }
    }
}
